﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;

namespace God.ShoppingWebApi.Entities
{
    /// <summary>
    /// 订单明细
    /// </summary>
    public class OrderItem : AuditedEntity<Guid>
    {
        //订单外键
        public Guid OrderId { get; set; }

        //商品Id
        public Guid GoodsId { get; set; }

        //购买数量
        public int BuyCount { get; set; }

        //订单项小计
        [Column(TypeName = "decimal(18,2)")]
        public decimal ItemAmount { get; set; }

        //导航属性-订单
        [ForeignKey("OrderId")]
        public virtual Order Order { get; set; }

        //导航属性-商品
        [ForeignKey("GoodsId")]
        public virtual CommodInfo CommodInfo { get; set; }
    }
}
